<?php
	include("config.php");
	session_start();
	if($_SERVER["REQUEST_METHOD"]=="POST")
	{
		$username = addslashes($_POST['name']);
		$password = md5(addslashes($_POST['pass']));
		
		$sql ="SELECT * FROM Customer WHERE email='$username' AND password='$password'";
		$result = mysql_query($sql);
		$count = mysql_num_rows($result);		
		if($count==1)
		{
			session_register("myusername");
			$_SESSION['login_user'] = $username;
			$_SESSION['logged_in'] = true;
			header("location:index2.php");
		}
		else
			$error="Your email or password is invalid";
	}
?>
<!DOCTYPE html>
<html lang="en">
<?php include('../inc/head.php'); ?>
<body>	 
	 <?php include('../inc/nav.php'); ?>
    <div class="container">
      <!-- Main hero unit for a primary marketing message or call to action -->
      <div class="hero-unit">
        <h1>Elliot's E-Commerce Website</h1>
        <p>In this site you will be able to buy items online, see our employees, and go to our facebook page.</p>
        <p><a class="btn btn-primary btn-large">Learn more &raquo;</a></p>
      </div>
      <hr>
      <footer>
        <p>&copy; Company 2012</p>
      </footer>
    </div> <!-- /container -->
    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="../inc/bootstrap/js/jquery.js"></script>
    <script src="../inc/bootstrap/js/bootstrap-min.js"></script>
  </body>
</html>
